home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
b
/
bestba.zip
/
{.BAT
next >
Wrap
DOS Batch File
|
1993-03-18
|
2KB
|
89 lines
@echo off
Rem (C) Daniel MONTARON 1989,90,92,93.
Rem MS DOS, DR DOS 3.3 +.Available release for DOS 2.x. Also available in french
Rem Version pour DOS 2.x disponible.
for %%x in (ERRORL,errorl,WHATKEY,whatkey,UNADDPATH,unaddpath) do if %1'==%%x' goto %1
if %2'==' goto ?
for %%x in (ADD,add,ADDPATH,addpath,DELS,dels,?,LISTE,liste,},Z,z) do if %1'==%%x' goto %1
if exist key.com goto s
echo ┤═!└u═!┤L═! >key.com
:s
if %2'==?' for %%x in (%3 %4 %5 %6 %7 %8 %9) do call %0 } %1 %%x
if %3'==}' for %%x in (%4 %5 %6 %7 %8 %9) do call %0 z %%x %1 %2
if %4'==}' for %%x in (%5 %6 %7 %8 %9) do call %0 z %%x %1 %2 %3
if %5'==}' for %%x in (%6 %7 %8 %9) do call %0 z %%x %1 %2 %3 %4
if %6'==}' for %%x in (%7 %8 %9) do call %0 z %%x %1 %2 %3 %4 %5
set $1=%2
set $=%1
if %2'=={' set $1=
if %2'=={' goto £
if not %3'=={' goto w
shift
:£
shift
if %2'==' goto w
%$% %2 %$1%
goto £
:ADD
echo set %2=%%%2%%;%3>$.bat
call $
del $.bat
goto w
:ADDPATH
set path0 = %PATH%
@echo on
PATH %PATH%;%2
@echo off
goto w
:DELS
%0 del ? %2 %3 %4 %5 %6 %7 %8 %9
:$
echo Confirm %2 %3 (y/N) ?
key
if errorlevel=89 if not errorlevel=90 %2 %3
if errorlevel=121 if not errorlevel=122 %2 %3
if %2'==del' if exist %3 echo %3 not deleted.
if %2'==del' if not exist %3 echo %3 deleted.
goto w
:ERRORL
set $$=Error Level
:EL
for %%x in (0 1 2) do if errorlevel=%%x00 set $1=%%x
for %%x in (0 1 2 3 4 5 6 7 8 9) do if errorlevel=%$1%%%x0 set $=%$1%%%x
for %%x in (0 1 2 3 4 5 6 7 8 9) do if errorlevel=%$%%%x set $1=%$%%%x
echo %$$% = %$1%
goto w
:LISTE
for %%x in ( %2 %3 %4 %5 %6 %7 %8 %9) do echo %%x
goto w
:Z
for %%x in (%3 %4 %5 %6 %7 %8 %9) do %%x %2
goto w
:WHATKEY
Echo Waiting for a key
key
set $$=Key
goto EL
:UNADDPATH
@echo on
path %PATH0%
@echo off
goto w
:?
set $=fil? fil*...
echo (c) Daniel Montaron 1989,90,92,93. -Usage:
echo %0 ADD env path env = PATH, LIB, APPEND, INCLUDE....
echo %0 ADDPATH path
echo %0 DELS %$%
echo %0 ERRORL
echo %0 LISTE %$%
echo %0 UNADDPATH
echo %0 WHATKEY
echo %0 command parameters { %$%
echo %0 command ? %$%
echo %0 command command2 ... } %$% command= COPY, DEL, DIR, REN...
:w
set $=
set $1=
set $$=